#include "AllTitle.h"


CGlobalCycle* CGlobalCycle::instance = nullptr;

CGlobalCycle* CGlobalCycle::Instance()
{
	if (instance == nullptr)
	{
		instance = new CGlobalCycle();
	}
	return instance;
}

CGlobalCycle::CGlobalCycle():time_per_frame(1000 / 60.0)
{
	time = GetTickCount();
}

	
CGlobalCycle::~CGlobalCycle()
{
}

	
void CGlobalCycle::RUN()
{
	while (1)
	{
		unsigned int t = GetTickCount() - time;
		if (t > time_per_frame) {
			time = GetTickCount() - (t - time_per_frame);

			Control();
		}
		else
		{
			Sleep(1);
		}


	}
}

void CGlobalCycle::Control()
{
}
